package br.com.playonline.persistencia;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.Expression;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import br.com.playonline.domain.Bolao;
import br.com.playonline.domain.TipoDeJogo;

@Component
public class BolaoHibernateDAO extends HibernateDAOGenerico<Bolao, Long> {

	@Autowired
	public BolaoHibernateDAO(SessionFactory sessionFactory) {
		super(sessionFactory);
	}
	
	public List<Bolao> findByTipoDeJogo(TipoDeJogo tipoDeJogo){
		List<Bolao> bolaos = findByCriteria(Expression.eq("tipoDeJogo", tipoDeJogo));
		return bolaos;
	}

}
